package cn.tmpan.dao;

import cn.tmpan.entity.Member;
import org.apache.ibatis.annotations.Param;

public interface MemberMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Member record);

    int insertSelective(Member record);

    Member selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Member record);

    int updateByPrimaryKey(Member record);

    int getUserCount();
    Member selectUserByUserNameAndPassword(@Param(value = "username") String username, @Param(value = "password") String password);

    /**
     * 通过用户名查询用户
     * @param username
     * @return
     */
    Member findUserByUserName(String username);

    /**
     * 更新用户sid
     * @param username
     * @param sid
     * @return
     */
    int updateSidByUserName(@Param(value = "username") String username,@Param(value = "sid")String sid);

    /**
     * 通过sid查询用户
     * @param sid
     * @return
     */
    Member selectUserBySid(String sid);

    /**
     * 修改用户手机
     * @param phone 手机号码
     * @param uid 用户id
     * @return
     */
    int updatePhoneByPk(@Param("phone") String phone, @Param("uid") Integer uid);
}